feat(protocol): publish protocol v1 schemas, golden vectors, and conformance runner - #6
Conversation
Publish the consumer-ready Psyche protocol v1 release surface required by issue OpenCoven#11 on top of the G2 foundation: - protocol/v1/: generated artifact set - self-contained JSON Schema (draft 2020-12) for all sixteen registry kinds plus the Coven boundary types and the store-owned transition, a generated TypeScript surface, byte-exact canonical golden vectors (positive, denial, stale-correlation, unknown-version, crash/restart, downgrade) with pinned SHA-256 digests, a machine-readable inventory with stability classes, and a sha256sum manifest for downstream pinning. - packages/psyche-protocol/: standalone, dependency-free conformance runner (psyche-conformance) implementing the consumer-v1 profile - negotiation, correlation, snapshot/attempt binding, adoption proof, fencing shape, cursor/restart, terminal authority shape, the full cancellation evidence matrix, result/artifact binding, append-only revision chains, structured-denial classification, and the canonical JSON domain. Emits bounded machine-readable results; no network, no credentials. - scripts/protocol/: single source of truth (definitions.mjs, vectors.mjs) and a deterministic generator; CI re-runs generation and fails on uncommitted drift. - crates/psyche-core/tests/protocol_golden.rs: cross-checks every golden vector through the real decoder and byte-compares canonical_bytes against the published artifacts. - docs/PROTOCOL.md: inventory, classification, canonical bytes, semantic versioning, compatibility windows, unknown-field/enum fail-closed behavior, migration/downgrade/rollback, conformance profile, and decision records. Canonicalization is RFC 8785; the JavaScript implementation is pinned to byte parity against the Rust-pinned request digests (sha256:75d651c5... launch, sha256:c8c3d0ca... input) and the decoder-recomputed effect digests. Refs OpenCoven#11 Signed-off-by: Timothy Wayne Gregg <5861166+CompleteDotTech@users.noreply.github.com>
The store-owned transition carries no schema_version of its own, so decode_document must deny it; the positive-vector cross-check ran the decode before reaching the None branch. Restructure the loop so store-owned vectors assert denial and registry vectors decode and re-canonicalize, matching docs/PROTOCOL.md section 2. Refs OpenCoven#11 Signed-off-by: Timothy Wayne Gregg <5861166+CompleteDotTech@users.noreply.github.com>
…tors psyche.error.v1 decodes exhaustively and only then refuses persistence, so the error-envelope golden vector belongs in the decode-and-recanonicalize path without an id-prefix assertion, while psyche.transition alone is a non-document. Encode the three cases as an explicit IdExpectation so each is asserted on its own terms. Refs OpenCoven#11 Signed-off-by: Timothy Wayne Gregg <5861166+CompleteDotTech@users.noreply.github.com>
Adding the protocol job to .github/workflows/ci.yml (issue OpenCoven#11 drift gate) changes the reviewed workflow content, so the evidence checker's hash pin must be updated in the same reviewed change. Root triggers, global env, the rust matrix, required job shapes, and every pinned G2 command are unchanged and still verified structurally. Refs OpenCoven#11 Signed-off-by: Timothy Wayne Gregg <5861166+CompleteDotTech@users.noreply.github.com>
CI status on this fork vehicle — verdict and one unrelated failureGreen (every run): Fix cycles applied to this PR (3 of 4):
Two failures that are NOT caused by this PR:
Per the CI contract this PR therefore stays draft: it is green except a step that is structurally impossible on the fork vehicle. Re-target upstream (restore write access to Refs OpenCoven#11 |
Summary
Publishes the consumer-ready Psyche protocol v1 release surface required by OpenCoven#11, on top of the G2 foundation:
protocol/v1/— generated, checksummed artifact set. Self-contained JSON Schema (draft 2020-12) for all sixteen registry kinds (psyche.identity_snapshot.v1…psyche.error.v1), the Coven boundary types (psyche.execution_request.v1launch/input, result bundle), and the store-owned transition; a generated TypeScript surface; byte-exact canonical JSON golden vectors with pinned SHA-256 digests; a machine-readable inventory with stability classes (stable-v1/experimental/internal/deprecated); and asha256sum-formatMANIFEST.sha256for downstream pinning.psyche.intent.v2), crash/restart (append-only revision chain whose revision 2 bindsprevious_revision_digestto revision 1's canonical bytes, plus a broken-chain profile-rejection), and downgrade (fail closed on an unsupported major).packages/psyche-protocol/— standalone conformance runner (psyche-conformance). Zero dependencies, no network, no credentials, bounded machine-readable output. Implements theconsumer-v1profile: negotiation, session/execution correlation, snapshot/attempt binding, adoption proof, ambiguity/fencing shape, cursor/restart, terminal-authority shape, the full cancellation evidence matrix (ported fromExecutionBinding::validate_cancellation), result/artifact binding (ported fromResultBundle::validate), append-only revision chains and frozen fields (ported fromvalidate_revision_chain), structured-denial/quarantine classification (RejectionReasonvocabulary), and the canonical JSON domain.scripts/protocol/— single source of truth + deterministic generator.node scripts/protocol/generate.mjsrewrites the artifact tree byte-identically; a new CI job re-runs it and fails on any uncommitted drift (schemas, fixtures, generated TypeScript).crates/psyche-core/tests/protocol_golden.rscross-checks every registry golden vector through the real decoder and byte-comparescanonical_bytesagainst the published files — schema↔decoder drift is caught in both directions.docs/PROTOCOL.md— the compatibility policy: semantic versioning of the artifact set, compatibility windows, unknown-field/enum/kind/major fail-closed behavior, migration/downgrade/rollback, deprecation, the conformance profile mapping, and decision records with alternatives.Canonicalization is RFC 8785. The JavaScript canonicalizer is pinned to byte parity against Rust-produced digests this repo's own CI already verifies:
sha256:75d651c5…/sha256:c8c3d0ca…(execution request goldens) and both decoder-recomputedeffect_digestvalues. The execution-request golden vectors are byte copies of the Rust fixtures, so their file digests are the pinned request digests.Issue
Refs OpenCoven#11
Test plan
node scripts/protocol/generate.mjs --check— artifact drift clean (56 files)npm --prefix packages/psyche-protocol test— 30/30 node:test unit tests (canonicalizer byte-parity vs Rust goldens, schema validator, full cancellation/revision/binding/negotiation matrix, CLI end-to-end + tamper detection)psyche-conformance run --root protocol/v1— 33/33 vectors pass, exit 0; tampered copies exit 2psyche-conformance verify --root protocol/v1— 55 files + 33 vectors verified, exit 0cargo fmt --all -- --check— clean (pinned 1.88.0 toolchain)cargo test -p psyche-core --test protocol_goldenand the full CIrustmatrix — compile proof deferred to CI (no local linker)protocolCI job green (generate/drift, runner tests, conformance, manifest verification)